let obj = {
    a : 1,
    b : {n:2} 
}
function deepCopy(obj){
    let newObj = {}
    for(let key in obj){
        if(obj.hasOwnProperty(key)){
            // if(typeof obj[key] === 'object' && obj[key]!==null){}
            if(obj[key] instanceof Object){
                newObj[key] = deepCopy(obj[key])

            }else{
                newObj[key] = obj[key]
            }
        }
    }
    return newObj
}